<template>
    <nut-tabbar
            @tab-switch="tabSwitch1"
            type="card"
            :tabbarList="tabList1"
    ></nut-tabbar>
</template>

<script>
    /* eslint-disable no-console */

    export default {
        name: "funcBar",
        data() {
            return {
                tabList1: [
                    {
                        'tabTitle': '预约就诊',
                        'curr': false,
                        'icon': 'http://51self-service.cn/images/nav-01.svg',
                        'activeIcon': 'http://51self-service.cn/images/nav-01.svg'
                    },
                    {
                        'tabTitle': '快速接诊',
                        'curr': false,
                        'icon': 'http://51self-service.cn/images/nav-02.svg',
                        'activeIcon': 'http://51self-service.cn/images/nav-02.svg'
                    },
                    {
                        'tabTitle': '收费管理',
                        'curr': false,
                        'icon': 'http://51self-service.cn/images/nav-03.svg',
                        'activeIcon': 'http://51self-service.cn/images/nav-03.svg'
                    },
                    {
                        'tabTitle': '我的收益',
                        'curr': false,
                        'icon': 'http://51self-service.cn/images/nav-04.svg',
                        'activeIcon': 'http://51self-service.cn/images/nav-04.svg'
                    }
                ]
            };
        },
        methods: {
            tabSwitch1: function (value, index) {
                console.log(index);
                if (index === 0) {
                    //约诊
                    this.$store.state.adviceType = 0;
                    this.$router.push({
                        name: 'advice'
                    });
                } else if (index === 1) {
                    //快速接诊
                    this.$store.state.adviceType = 1;
                    this.$router.push({
                        name: 'advice'
                    });
                } else if (index === 2) {
                    //快速接诊
                    this.$store.state.adviceType = 2;
                    this.$router.push({
                        name: 'costList'
                    });
                } else {
                    this.$router.push({
                        name: 'profit'
                    });
                    // this.$toast.text("系统升级中，暂停服务！");
                }
            },
        }
    }
</script>

<style scoped>
    .nut-tabbar {
        border: 0px;
        width: 100%;
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        height: 70px;
        box-sizing: border-box;
        background: #fff;
        margin-top: 12px;
    }
</style>
